import { createStore, combineReducers, applyMiddleware } from 'redux'
import preLoanMangeStore from './preLoanStore/reducer'
import afterLoanStore from './afterLoanStore/reducer'
import loaningStore from "./LoaningStore/reducer"
import customerStore from './customerStore/reducer'
import dotoStore from './dotoStore/reducer'
import systemRoleStore from './systemRoleStore/reducer'
import thunk from 'redux-thunk'

const mainReducer = combineReducers({
    preLoanMange: preLoanMangeStore,
    afterLoanStore,
    daiZhongList: loaningStore,
    customer: customerStore,
    doto: dotoStore,
    systemRoleStore
})


let store = createStore(mainReducer, applyMiddleware(thunk))

store.subscribe(() => {
    console.log('检测数据状态变化', store.getState());
})
export default store